package net.sf.rose.util;

import java.io.IOException;
import java.io.InputStream;

/**
 * @author fengjian
 * 
 */
public class SystemUtil {

	/**
	 * 
	 */
	protected InputStream getResource(Class<?> c, String file) {
		return c.getResourceAsStream(file);
	}

	/**
	 * 
	 */
	public static java.net.URL getResourceURL(String name) {
		return ClassLoader.getSystemResource(name);
	}

	/**
	 * 
	 */
	public static java.io.InputStream getResourceStream(String name) {
		return ClassLoader.getSystemResourceAsStream(name);
	}

	/**
	 * 
	 */
	public static Process execute(String command) {
		try {
			return Runtime.getRuntime().exec(command);
		} catch (IOException e) {
			e.printStackTrace();
		}
		return null;
	}

}
